package com.wxp.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.wxp.entity.User;


@Repository
public interface  UserDao extends JpaRepository<User, String>,JpaSpecificationExecutor<User> {
    
	 @Query("delete from User u where u.userId = :userId")
	 @Modifying
	 public void deleteUser(@Param("userId")String userId);
	 
	 
	 public User findFirstByNameCode(String nameCode);
	 
	 @Query(value="delete from t_user_role u where u.user_Id_ = :userId" ,nativeQuery = true)
	 @Modifying
	 public void deleteUserRole(@Param("userId")String userId);


}
